package com.tongji.housediy.controller.goodsCMD
{
	import com.tongji.housediy.events.goodsEvent.GetCollectionEvent;
	import com.tongji.housediy.model.GoodsModel;
	import com.tongji.housediy.service.GoodsService;
	
	import org.robotlegs.mvcs.Command;
	
	/**
	 * 
	 * @author yanghanbing
	 * 2011/7/04
	 */ 
	public class GetCollectionCommand extends Command
	{
		[Inject]
		public var model:GoodsModel;
		
		[Inject]
		public var service:GoodsService;
		
		[Inject]
		public var event:GetCollectionEvent;
		
		override public function execute():void
		{
			switch(event.type)
			{
				case "getCollections":
					service.getCollection(event.userID);
					break;
				case "updateCollections":
					model.updateCollections(event.colletionArray);
					break;
			}
		}
	}
}